package com.flx.noodle.websocket.dao.mapper;

import com.flx.noodle.websocket.entity.SSOUser;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by fenglixiong on 2017/10/2.
 */
public class UserRowMapper implements RowMapper<SSOUser> {

    public SSOUser mapRow(ResultSet resultSet, int i) throws SQLException {
        SSOUser ssoUser = new SSOUser();
        ssoUser.setUserId(resultSet.getInt("id"));
        ssoUser.setUserName(resultSet.getString("user_name"));
        ssoUser.setPassWord(resultSet.getString("pass_word"));
        ssoUser.setInfo(resultSet.getString("info"));
        ssoUser.setSessionId(resultSet.getString("session_id"));
        return ssoUser;
    }
}
